package com.linkstec.jodd;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import jodd.bean.BeanUtil;

public class TestFoo {

	private static final Logger logger = LoggerFactory.getLogger(TestFoo.class);
	public static void main(String[] args) {
		Foo foo = new Foo();
        BeanUtil.pojo.setProperty(foo, "readwrite", "readwritedata");
        System.out.println(BeanUtil.pojo.getProperty(foo, "readwrite").toString());
        BeanUtil.declared.setProperty(foo, "readonly", "readonlydata");
        System.out.println(foo.getReadonly());
        logger.info(foo.getReadonly());

	}

}
class Foo {
    private String readwrite;   // 提供 getter 和 setter
    private String readonly;    // 只提供getter
	public String getReadwrite() {
		return readwrite;
	}
	public void setReadwrite(String readwrite) {
		this.readwrite = readwrite;
	}
	public String getReadonly() {
		return readonly;
	}
	public void setReadonly(String readonly) {
		this.readonly = readonly;
	}
    
}